﻿using System;
using TopMachine.Topping.Common.Structures;
using TopMachine.Topping.Dto;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Collections.Generic;
using Topping.Core.Logic.Client;
namespace Topping.Core.Logic
{

    [ServiceContract(Namespace = "", SessionMode = SessionMode.Allowed)]
    public interface IProxy
    {
        // Login 
        [OperationContract]
        Guid Login(string userName, string passWord, int version);

        [OperationContract]
        bool CheckVersion(string version);

        // Messages 
        [OperationContract]
        void ActivateChat();

        [OperationContract]
        void DeactivateChat();

        [OperationContract]
        System.Collections.Generic.List<MessageDto> GetMessages();

        [OperationContract]
        void SendMessage(TopMachine.Topping.Dto.MessageDto m);

        [OperationContract]
        void SendMessageToRoom(int x, TopMachine.Topping.Dto.MessageDto m);

        [OperationContract]
        string[] ListRoomPlayers(int roomid);

        [OperationContract]
        string[] ListRoomActivePlayers(int roomid);
        
        // Rooms 
        [OperationContract]
        RoomDto GetRoom(int roomid);

        //// Rooms 
        //[OperationContract]
        //System.Collections.Generic.List<Room> GetRooms();

        // Rooms 
        [OperationContract]
        System.Collections.Generic.List<RoomDto> GetRoomsDto();

        [OperationContract]
        RoomDto InitRoom(Topping.Core.Logic.Room room, bool generate);

        [OperationContract]
        RoomDto JoinRoom(int roomId);

        [OperationContract]
        void Logoff();
        
        [OperationContract]
        void ResetRooms();

        [OperationContract]
        void LeaveAnyRoom();

        [OperationContract]
        RoomDto LeaveRoom();

        [OperationContract]
        GeneratedGameDto GetGame();

        [OperationContract]
        void SetGame(GeneratedGameDto game);

        [OperationContract]
        void GetListPlayedRound(string playerSearch);

        [OperationContract]
        string[] ListPlayers();
             
        [OperationContract]
        void StartGame();

        [OperationContract]
        void FinishGame();

        [OperationContract]
        void AddPlayedRound(PlayerSummaryDto summary, PlayedGameRoundDto pgr);

        [OperationContract]
        List<GamesDetailDto> GetGamesDetail(string player, int year, int mont, Guid configId);

        [OperationContract]
        FinalRoomDto GetFinalRoom(int RoomId);

        //Configurationn
        [OperationContract]
        bool UpdateConfiguration(TopMachine.Topping.Dto.ConfigGameDto cfg);

        [OperationContract]
        bool DeleteConfiguration(TopMachine.Topping.Dto.ConfigGameDto cfg);

        [OperationContract]
        System.Collections.Generic.List<TopMachine.Topping.Dto.ConfigGameDto> GetConfigurations();

        [OperationContract]
        System.Collections.Generic.List<TopMachine.Topping.Dto.RankingDto> GetRankings(string player, int year, int mont, Guid ConfigId);

        [OperationContract]
        bool DeleteGameXML(string fn);
    
    }
}
